package com.xuecheng.teaching.agent;

import com.xuecheng.api.comment.model.dto.CommentDTO;
import com.xuecheng.api.comment.model.dto.CommentReplyDTO;
import com.xuecheng.api.comment.model.qo.CommentModel;
import com.xuecheng.api.comment.model.vo.CommentReplyVO;
import com.xuecheng.api.comment.model.vo.CommentVO;
import com.xuecheng.api.content.model.dto.CoursePubDTO;
import com.xuecheng.api.teaching.model.dto.TeachplanWorkDTO;
import com.xuecheng.common.constant.XcFeignServiceNameList;
import com.xuecheng.common.domain.page.PageRequestParams;
import com.xuecheng.common.domain.page.PageVO;
import com.xuecheng.common.domain.response.RestResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * @author by wangwei
 * @date 2021/12/25.
 */
@FeignClient ( value = XcFeignServiceNameList.XC_COMMENT_SERVICE )
public interface CommentApiAgent {
    String SERVICE_CONTEXT_PRE = "comment";

    /**
     * 课程评论列表
     *
     * @param params
     * @param commentModel
     * @return
     */
    @PostMapping ( SERVICE_CONTEXT_PRE + "/course-comment/for-course" )
    PageVO<CommentDTO> queryCommentList(@RequestParam PageRequestParams params, @RequestBody CommentModel commentModel);

    @PostMapping ( "comment/comment/create" )
    CommentDTO createComment(@RequestBody CommentVO vo, @RequestParam String username);

    @GetMapping ( "comment/l/course-statistics/{targetId}" )
    public CommentVO statisticsComment(@PathVariable Long targetId);

    @PostMapping("comment/l/comment_reply")
    public CommentReplyDTO replyMsg(@RequestBody CommentReplyVO commentReplyVO);

    @DeleteMapping("comment/m/delete-comment/{commentId}")
    public void deleteComment(@PathVariable Long commentId);


    /**
     * 机构的评论列表
     *
     * @param params
     * @param commentModel
     * @return
     */
    @PostMapping ( SERVICE_CONTEXT_PRE + "/course-comment/list" )
    PageVO<CommentDTO> queryCourseCommentList(@RequestParam PageRequestParams params, @RequestBody CommentModel commentModel);


    /**
     * 运营平台的评论列表
     *
     * @param params
     * @return
     */
    @GetMapping ( SERVICE_CONTEXT_PRE + "/m/course-comment/list-all" )
    PageVO<CommentDTO> queryMCourseCommentList(@RequestParam PageRequestParams params);

    @DeleteMapping("comment/m/delete-comment/batch-del/{request}")
    public void deleteComments(@PathVariable String request);


}
